package org.grow.sha.basic.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.grow.sha.serviceAop.BackMenuException;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MondayAspect {

    @Pointcut("@annotation(March)")
    public void mPointcut(){}
    @Around("mPointcut()")
    public Object mAdvice(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("aop success");
        Object o  = joinPoint.proceed();
        if (3==3){
            throw  new BackMenuException("???" +joinPoint.getSignature().getName());

        }

        return o;
    }

}
